package my.graduation.controller.patient;

import my.graduation.dto.DocRegScheDto;
import my.graduation.dto.PatRegScheDto;
import my.graduation.entity.RegistrationSchedule;
import my.graduation.entity.RegistrationSpots;
import my.graduation.result.Result;
import my.graduation.service.RegistrationScheduleService;
import my.graduation.service.RegistrationSpotsService;
import my.graduation.vo.DoctorRegVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: RavenLyn
 * @Date: 2024-12-17
 */
@RestController
@RequestMapping("/patient")
public class RegistrationController {


    @Autowired
    private RegistrationScheduleService regScheService;

    @Autowired
    private RegistrationSpotsService regSpotsService;

    /**
     * 根据日期获取该门诊下的医生排班
     * @param dto
     * @return
     */
    @PostMapping("/reg_sche")
    public Result<List<DoctorRegVO>> patientGetRegScheList (@RequestBody PatRegScheDto dto){
        return regScheService.patientGetRegScheList(dto);
    }

    /**
     * 根据regScheId获取医生挂号号源
     * @param dto
     * @return
     */
    @PostMapping("/reg_spots")
    public Result<List<RegistrationSpots>> patientGetRegSpotsList (@RequestBody PatRegScheDto dto){
        return regSpotsService.patientGetRegSpotsList(dto);
    }
}
